﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EzDesk.Clients.Utility;

namespace EzDesk.DesktopClient.Model
{
    public partial class Feed
    {
        public Feed(FeedClientModel model)
        {
            this.FeedID = model.FeedId.ToString();
            this.AppName = model.AppName;
            this.IconUrl = model.IconUrl;
            this.CreateOn = model.CreateOn;
            this.UpdateOn = model.UpdateOn;
            this.IsAvailable = model.IsAvailable;
            this.IsRead = model.IsRead;
            this.IsMark = model.IsMark;
            this.LastChangeOn = model.LastChangeOn;
            this.OriginalTitle= model.OriginalData.Title;
            this.OriginalBody = model.OriginalData.Body;
            this.TransformedTitle = model.TransformedData.Title;
            this.TransformedBody = model.TransformedData.Body;
            this.Type = model.Type;
        }

        public void CopyFrom(FeedClientModel model)
        {
            this.AppName = model.AppName;
            this.IconUrl = model.IconUrl;
            this.CreateOn = model.CreateOn;
            this.UpdateOn = model.UpdateOn;
            this.IsAvailable = model.IsAvailable;
            this.IsRead = model.IsRead;
            this.IsMark = model.IsMark;
            this.LastChangeOn = model.LastChangeOn;
            this.OriginalTitle = model.OriginalData.Title;
            this.OriginalBody = model.OriginalData.Body;
            this.TransformedTitle = model.TransformedData.Title;
            this.TransformedBody = model.TransformedData.Body;
            this.Type = model.Type;
        }
    }
}
